package com.yxxmg.mybatisplussample.service;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Component;

import com.yxxmg.mybatisplussample.api.TeacherService;
import com.yxxmg.mybatisplussample.domain.Teacher;

import lombok.extern.slf4j.Slf4j;

/**
 * @author : yxxmg
 * @version : 1.0
 * @description :
 * @since : 2024/11/29
 */
@Component
@Slf4j
public class TeacherLoader {
    @Resource
    private TeacherService teacherService;

    @PostConstruct
    public void init() {
        // List<Teacher> teacherList = this.teacherService.list();
        List<Teacher> teacherList = this.teacherService.queryAll();
        if (CollectionUtils.isEmpty(teacherList)) {
            return;
        }
        for (Teacher teacher : teacherList) {
            log.info("teacher:{}", teacher);
        }

    }
}
